package server.demo.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.util.List;

public class TicketPurchaseRequest {
    @NotNull(message = "用户ID不能为空")
    private Long userId;
    
    @NotEmpty(message = "购票信息不能为空")
    private List<TicketInfo> tickets;
    
    public static class TicketInfo {
        @NotNull(message = "车次ID不能为空")
        private Long trainId;
        
        @NotNull(message = "座位ID不能为空") 
        private Long seatId;
        
        @NotBlank(message = "乘客姓名不能为空")
        private String passengerName;
        
        @NotBlank(message = "乘客身份证不能为空")
        private String passengerIdCard;
        
        @NotNull(message = "起始站ID不能为空")
        private Long startStationId;
        
        @NotNull(message = "终点站ID不能为空")
        private Long endStationId;
        
        public Long getTrainId() {
            return trainId;
        }
        
        public void setTrainId(Long trainId) {
            this.trainId = trainId;
        }
        
        public Long getSeatId() {
            return seatId;
        }
        
        public void setSeatId(Long seatId) {
            this.seatId = seatId;
        }
        
        public String getPassengerName() {
            return passengerName;
        }
        
        public void setPassengerName(String passengerName) {
            this.passengerName = passengerName;
        }
        
        public String getPassengerIdCard() {
            return passengerIdCard;
        }
        
        public void setPassengerIdCard(String passengerIdCard) {
            this.passengerIdCard = passengerIdCard;
        }
        
        public Long getStartStationId() {
            return startStationId;
        }
        
        public void setStartStationId(Long startStationId) {
            this.startStationId = startStationId;
        }
        
        public Long getEndStationId() {
            return endStationId;
        }
        
        public void setEndStationId(Long endStationId) {
            this.endStationId = endStationId;
        }
    }
    
    public Long getUserId() {
        return userId;
    }
    
    public void setUserId(Long userId) {
        this.userId = userId;
    }
    
    public List<TicketInfo> getTickets() {
        return tickets;
    }
    
    public void setTickets(List<TicketInfo> tickets) {
        this.tickets = tickets;
    }
}